package com.byyy.ccts.modules.ysjl.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.byyy.ccts.core.utils.StringUtils;
import com.byyy.ccts.modules.ysjl.enums.UserRankEnum;
import com.byyy.ccts.modules.ysjl.enums.UserVipStyleEnum;
import lombok.Data;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.sql.Timestamp;
import java.util.List;

/**
 * @projectName: TODO
 * @package: com.byyy.ccts.modules.ysjl.entity
 * @className: YsjlActivity
 * @description: TODO
 * @author: LYB
 * @Date: 2023/9/3 16:12
 * @updateUser: LYB
 * @updateDate: 2023/9/3 16:12
 * @updateRemark:
 * @version: v1.0
 */
@TableName("T_YSJL_USER")
@Data
public class YsjlUser {

    @TableId(value="ID", type = IdType.UUID)
    @TableField(value="ID")
    private String id;
    @TableField(value="OPENID")
    private String openid;
    @TableField(value="STATUS")
    private String status;
    @TableField(value="VIP_LEVEL")
    private int vipLevel;
    @TableField(value="NAME")
    private String name;
    @TableField(value="PIC")
    private String pic;
    @TableField(value="LOGIN_CNT")
    private int loginCnt;
    @TableField(value="LOGIN_TIME")
    @JSONField(format ="yyyy-MM-dd HH:mm:ss")
    private Timestamp loginTime;
    @TableField(value="ADD_TIME")
    @JSONField(format ="yyyy-MM-dd HH:mm:ss")
    private Timestamp addTime;
    @TableField(value="EDIT_TIME")
    @JSONField(format ="yyyy-MM-dd HH:mm:ss")
    private Timestamp editTime;
    @TableField(value="MANAGER")
    private String manager;
    @TableField(value="CURRENT_SCORE")
    private int currentScore;
    @TableField(value="SCORE")
    private int score;
    @TableField(value="RANK")
    private int rank;
    @TableField(value="VIP_STYLE")
    private int vipStyle;
    @TableField(value="VIP_END_DATE")
    @JSONField(format ="yyyy-MM-dd HH:mm:ss")
    private Timestamp vipEndDate;
    @TableField(value="NICK_NAME")
    private String nickName;
    @TableField(value="ACTIVITY_CNT")
    private int activityCnt;
    @TableField(value="RACKET")
    private String racket;


    @TableField(exist = false)
    private String rankName;
    @TableField(exist = false)
    private String vipStyleName;
    @TableField(exist = false)
    private List<Integer> abilityList;
    @TableField(exist = false)
    private List<YsjlUserAbility> userAbilityList;

    public String getRankName() {
        return UserRankEnum.getMsgByCode(this.rank);
    }

    public String getVipStyleName() {
        return UserVipStyleEnum.getMsgByCode(this.vipStyle);
    }
}
